import { Base } from '../../utils/base.js'

class Product extends Base {
  constructor() {
    super()
  }
  //获取商品详细信息
  getGoodsById(parames, callback) {
    let url = "/purchase/goods/getGoodsById";
    this.commonRequest(url, parames, callback);
  } 
  //添加商品进购物车
  addCart(parames, callback) {
    let url = "/purchase/cart/add";
    this.commonRequest(url, parames, callback);
  } 

  //获取购物车总数
  getCart(parames, callback) {
    let url = "/purchase/cart/get";
    this.commonRequest(url, parames, callback);
  } 

  // 创建订单
  createOrderAndDetails(parames, callback) {
    let url = '/purchase/order/createOrderAndDetails';
    this.commonRequest(url, parames, callback);
  }
  // 立即抢购
  nowBuy(parames, callback) {
      let url = '/purchase/order/createOrderAndDetailsRightNow';
      this.commonRequest(url, parames, callback);
  }
}
module.exports = {
  Product
}